package com.xywy.me;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.TextView;

import com.xywy.R;
import com.xywy.common.BaseActivity;
import com.xywy.common.widget.TitleBar2;

/**
 * 我 - 设置 - 账户 -更换手机号码
 * 
 * @author xiaogd
 * 
 */
public class SetupAcMobileActivity extends BaseActivity {
	private static final String TAG = "SetupAcMobileActivity";
	private Context mContext;
	private String mobile;
	private TextView tvMobile;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		// 设置为全屏
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.me_setup_ac_mobile);

		this.preInit();
		this.initView();
		this.loadData();
		// this.setListener();
	}

	public void startOnClick(View view) {
		switch (view.getId()) {
		case R.id.tv_setup_ac_ghsj: // 更换手机号
			next();
			break;
		}
		;
	}

	/**
	 * 验证密码
	 */
	private void next() {

		Intent intent = new Intent(this,
				SetupVerificationPasswordActivity.class);// SetupAcValMobileActivity验证手机号
		intent.putExtra("mobile", mobile);
		intent.putExtra("TAG", 1);
		startActivity(intent);
	}

	@Override
	protected void onResume() {
		super.onResume();

	}

	@Override
	protected void onPause() {
		super.onPause();

	}

	@Override
	public void preInit() {
		mContext = this.context;
		Intent intent = this.getIntent();
		mobile = intent.getStringExtra("mobile");
	}

	@Override
	public void loadData() {

	}

	@Override
	public void initView() {
		// title
		TitleBar2 titleBar = (TitleBar2) findViewById(R.id.me_setup_ac_mobile_title_bar);
		titleBar.onClickBack(this);
		TextView tvTitle = titleBar.getTitle();
		TextView tvBack = titleBar.getTvBack();
		titleBar.getGo().setVisibility(View.INVISIBLE);
		tvTitle.setText(getString(R.string.me_setup_account_sjh));
		tvBack.setText(getString(R.string.me_setup_account));

		tvMobile = (TextView) findViewById(R.id.tv_setup_ac_mobile);
		String kg = "    ";
		// mobile = mobile.substring(0, 3) + kg + mobile.substring(3, 7) + kg
		// + mobile.substring(7, 11);
		tvMobile.setText(mobile);
	}

}
